{template 'header'}

<div class="user-box">
          <ul class="action-list user-show" style="text-align: center;">
            <li>

              <img src="{php echo tomedia($userinfo['avatar'])}" class="profile" style="width:60px;height:60px;">
              <span id="remote" style="padding-left:10px">任务状态：未知</span>
            </li>
			
          </ul>


		  <center><ul>
				<li id="jh" style="display:none"><span id="new">继续</span>&nbsp;<span id="start">申请计划</span></li>
                <li id="dd" style="display:none"><span id="dingdan">采集订单</span>&nbsp;<span id="shijian">7天</span></li>
          </ul></center>

          <ul class="action-list">
			
			
			
			
			
			<li>
              <a href="javascript:">
                <em class="icon icon-address"></em>
                <span>开始申请计划 <input type="button" id="pc_new0" value="继续申请"/>&nbsp;&nbsp;<input type="button" id="pc_new1" value="重头申请"/></span>
                <em class="cur"></em>
              </a>
            </li>


            <li>
              <a href="javascript:">
                <em class="icon icon-temai"></em>
                <span>开始采集订单 <input type="button" id="pc_shijian1" value="今天"/>&nbsp;&nbsp;<input type="button" id="pc_shijian7" value="本周"/>&nbsp;&nbsp;<input type="button" id="pc_shijian30" value="本月"/></span>
                <em class="cur"></em>
              </a>
            </li>
            
			
          </ul>
          
          
        </div>

<script>
function remote(){
var url = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey));}";		
$.post(url, function(dat){
dat = eval('('+dat+')');

if(dat.remote==1){
//

$('#remote').html('任务状态：未执行，请稍后！');
window.setTimeout(remote,5000);
//
}else{

$('#remote').html('任务状态：执行中');

}

});
}


function remote_new0(){
var urlnew = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey,'start'=>1,'new'=>0));}";
$.post(urlnew, function(dat){});

var url = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey));}";		


$.post(url, function(dat){
dat = eval('('+dat+')');

if(dat.remote==1){
//
$('#jh').hide();
$('#dd').hide();
$('#remote').html('任务状态：未执行，请稍后！');
window.setTimeout(remote_new0,5000);
//
}else{

$('#remote').html('任务状态：执行中');
$('#jh').show();

if(dat.new==1){$('#new').html('重头');}else{$('#new').html('继续');}


}

});
}


function remote_new1(){
var urlnew = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey,'start'=>1,'new'=>1));}";
$.post(urlnew, function(dat){});

var url = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey));}";		


$.post(url, function(dat){
dat = eval('('+dat+')');

if(dat.remote==1){
//
$('#jh').hide();
$('#dd').hide();
$('#remote').html('任务状态：未执行，请稍后！');
window.setTimeout(remote_new1,5000);
//
}else{

$('#remote').html('任务状态：执行中');
$('#jh').show();

if(dat.new==1){$('#new').html('重头');}else{$('#new').html('继续');}


}

});
}


function remote_shijian1(){
var urlnew = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey,'dingdan'=>1,'shijian'=>1));}";
$.post(urlnew, function(dat){});

var url = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey));}";		


$.post(url, function(dat){
dat = eval('('+dat+')');

if(dat.remote==1){
//
$('#jh').hide();
$('#dd').hide();
$('#remote').html('任务状态：未执行，请稍后！');
window.setTimeout(remote_shijian1,5000);
//
}else{

$('#remote').html('任务状态：执行中');
$('#dd').show();

if(dat.shijian==1){$('#shijian').html('今日');}
if(dat.shijian==7){$('#shijian').html('本周');}
if(dat.shijian==30){$('#shijian').html('本月');}
}

});
}

function remote_shijian7(){
var urlnew = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey,'dingdan'=>1,'shijian'=>7));}";
$.post(urlnew, function(dat){});

var url = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey));}";		


$.post(url, function(dat){
dat = eval('('+dat+')');

if(dat.remote==1){
//
$('#jh').hide();
$('#dd').hide();
$('#remote').html('任务状态：未执行，请稍后！');
window.setTimeout(remote_shijian7,5000);
//
}else{

$('#remote').html('任务状态：执行中');
$('#dd').show();

if(dat.shijian==1){$('#shijian').html('今日');}
if(dat.shijian==7){$('#shijian').html('本周');}
if(dat.shijian==30){$('#shijian').html('本月');}
}

});
}

function remote_shijian30(){
var urlnew = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey,'dingdan'=>1,'shijian'=>30));}";
$.post(urlnew, function(dat){});

var url = "{php echo $this->createMobileUrl('abcnbapiall_setting',array('aouthkey'=>$aouthkey));}";		


$.post(url, function(dat){
dat = eval('('+dat+')');

if(dat.remote==1){
//
$('#jh').hide();
$('#dd').hide();
$('#remote').html('任务状态：未执行，请稍后！');
window.setTimeout(remote_shijian30,5000);
//
}else{

$('#remote').html('任务状态：执行中');
$('#dd').show();

if(dat.shijian==1){$('#shijian').html('今日');}
if(dat.shijian==7){$('#shijian').html('本周');}
if(dat.shijian==30){$('#shijian').html('本月');}
}

});
}



$(function(){

$("#pc_new0").click(function(){ 
　　　remote_new0();
　　}); 


$("#pc_new1").click(function(){ 
　　　remote_new1();
　　});

$("#pc_shijian1").click(function(){ 
　　　remote_shijian1();
　　});
$("#pc_shijian7").click(function(){ 
　　　remote_shijian7();
　　});
$("#pc_shijian30").click(function(){ 
　　　remote_shijian30();
　　});


});
</script>


{if $follow!=1}
<script>
layer.open({
	
	title:'- 管理个人中心，请先长按下图 -',
    content: '<center><div style="width:100%;"><br><img src="{$_W['account']['qrcode']}" width="100%"><br><font color="red">本功能仅限会员使用</font></div></center>',
    btn: ['返回首页', '返回微信'],
    shadeClose: false,
	closeBtn: false,
    yes: function(){
       window.location.href='{php echo $this->createMobileUrl('index', array('op' => 'new'))}';	
    }, no: function(){
		WeixinJSBridge.call('closeWindow');
    }
});
</script>
{/if}

<script>
function nbqdtip()
{
 layer.open({
    content: '请点击公众号底部菜单签到'
    ,skin: 'msg'
    ,time: 3
  });
}
</script>
{template 'footer'}